<template>
	<view class="all">
		<view v-if="show==1" class="wugonghui">暂无公会</view>
		<view v-if="show==2" class="yougonghui">
			<view class="gonghuixinxi">
				<image src="@/static/logo.png" class="gonghuitouxiang"></image>
				<view class="huizhang">{{wodegonghui.huizhang}}(会长)</view>
				<view class="xuanyan">公会宣言</view>
				<view class="gonghuixuanyan">{{wodegonghui.jianshu}}</view>
			</view>
			<view class="gonghuichengyuan">
				<scroll-view class="suoyouchengyuan" :scroll-y="true">
					<view v-for="(item,index) in suoyouchengyuan" class="danggechengyuan">
						<image src="@/static/logo.png" class="chengyuantouxiang"></image>
					     <view class="chengyuanzhang">{{item.zhang}}</view>
						 <view class="chengyuanshnegchang">{{item.shengchang}}</view>
		
					</view>
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:1,
				wodegonghui:[],
				zhang:'',
				suoyouchengyuan:[]
			}
		},
		async created(){
			this.zhang=getApp().globalData.zhang
			uni.request({
				url:"http://124.221.104.5:8080/jbgn/wodegonghui",
				data:{zhang:this.zhang},
				success: (res) => {
					if(res.data!="")
					 this.show=2
					this.wodegonghui=res.data

				}
			})
			await new Promise((res)=> setTimeout(res,500))
			 if(this.show==2){
				 uni.request({
				url:"http://124.221.104.5:8080/jbgn/gonghuichengyuan",
				data:{zhang:this.zhang},
				success: (res) => {
					this.suoyouchengyuan=res.data
				}
			})
			 }
			
		},
		methods: {
			
		}
	}
</script>

<style>
	.all{
		position: absolute;
		 width: 601rpx;
		height: 378rpx;
		margin-left:150rpx ;
		top: 0%;
	}
	.wugonghui{
		width: 601rpx;
		height: 378rpx;
		text-align: center;
		line-height: 378rpx;
		font-size: 30rpx;
	}
	.yougonghui{
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.gonghuixinxi{
		width:350rpx ;
		height: 378rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		
	}
	.gonghuitouxiang{
		margin-top: 30rpx;
		width: 125rpx;
		height: 125rpx;
		border-radius: 100%;
	}
	.huizhang{
		margin-top: 15rpx;
		height: 30rpx;
		font-size: 25rpx;
	}
	.xuanyan{
		font-size: 20rpx;
		height: 30rpx;
		margin-top: 25rpx;
	}
	.gonghuixuanyan{
		font-size: 18rpx;
		width:200rpx ;
		text-align: center;
		word-break: break-all;
	}
	.gonghuichengyuan{
		width: 251rpx;
		height: 378rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.danggechengyuan{
		width:251rpx ;
		height: 50rpx;
		border: 1rpx solid aqua;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.chengyuantouxiang{
		width: 45rpx;
		height: 45rpx;
		border-radius: 100%;
		margin-left: 20rpx;
	}
	.chengyuanzhang{
		width: 80rpx;
		margin-left: 10rpx;
		text-align: center;
		word-break: break-all;
		
	
	}
	.chengyuanshnegchang{
		margin-left: 50rpx;
		
	}
	
</style>